20260713-WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED-etc#10920
Conversation
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10920
|
Retest this please |
|
Retest this please Jenkins. CAVP self test failed |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10920
Scan targets checked: linuxkm-bugs, linuxkm-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
|
retest this please |
|
Needs fully reviewed for being allowed with FIPS use before merged. |
There was a problem hiding this comment.
We are in discussions with the CSTL regarding this solution. The CSTL has concerns if we were to incorporate this solution in either of the upcoming submissions.
We are seeking a resolution to satisfy the CSTL and CMVP but I don't think it would be safe to merge this before we have resolved the CSTL's concerns.
EDIT: Discussed with Douzzer, I think we have a path forward. Dismissing this request for changes.
d8bfd27 to
b8850e3
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10920
Scan targets checked: linuxkm-bugs, linuxkm-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
|
Note the Jenkins CAVP self-test builds for fips-ready depend on the fix currently at the head of wolfssl/fips#402 . |
|
Note the multi-test failure, is a false positive due to a multi-test bug to be fixed Monday, and is firing on code in |
wolfssl/wolfcrypt/aes.h: if HAVE_FIPS && !WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED, make wc_AesGcmEncrypt() a WOLFSSL_LOCAL, and if !_WC_BUILDING_AES_C, add a WC_DEPRECATED() attribute to it. wolfssl/wolfcrypt/wc_compat.h, wolfssl/wolfcrypt/include.am, .wolfssl_known_macro_extras: add wc_compat.h: when HAVE_FIPS and !WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED, shim wc_AesGcmEncrypt() to remap it to FIPS-allowed APIs. wolfssl/wolfcrypt/types.h: at the end, #ifndef BUILDING_WOLFSSL, #include <wolfssl/wolfcrypt/wc_compat.h>, to assure transparent shimming of wc_AesGcmEncrypt() for all outside callers. wolfcrypt/src/evp.c, wolfcrypt/src/hpke.c, wolfcrypt/src/pkcs7.c, wolfcrypt/benchmark/benchmark.c, wolfcrypt/test/test.c, wolfssl/ssl.h: #include <wolfssl/wolfcrypt/wc_compat.h> to shim in-library/in-module calls to wc_AesGcmEncrypt(). src/internal.c: in TicketEncDec(), add const attributes to constable input args, and fix swapped out/in in calls to wc_AesGcmEncrypt(). tests/api/test_aes.c: in test_wc_AesGcmEncryptDecrypt(), skip longIV test if WC_TEST_AES_GCM_ENCRYPT_NO_NONSTD_IV (defined by wc_compat.h when needed). wolfssl/wolfcrypt/error-crypt.h, wolfssl/error-ssl.h, wolfcrypt/src/error.c, src/internal.c: * add FIPS_WRONG_API_E; * put several error codes back into sequence in wc_GetErrorString() switch(). * move wc_static_assert()s from headers to corresponding .c files, to eliminate dependency on wolfcrypt/types.h; * remove unneeded #include <wolfssl/wolfcrypt/types.h> from error-crypt.h.
…nd AES-XTS (AesGcmCrypt_1(), km_AesXtsEncrypt(), and km_AesXtsDecrypt()), bypass FIPS wrappers to avoid frivolous overhead, with decisive check after looping by the Final function.
…I, and intel_flags (3f3ebca / wolfSSL#10871) to avoid frivolous atomic access overhead. Also use regular int, not cpuid_flags_atomic_t, for cpuid_flags in the WOLFSSL_ARMASM path, and similarly use a regular int for aes_ppc64_use_crypto in the WOLFSSL_PPC64_ASM_CRYPTO path.
…l_known_macro_extras: * also inhibit recursive evaluation midway through random.h, fips.h, and fips_test.h (circular dependencies). * add WC_FIPS_ENUM_CAST_ID_DEFINED to allow detection of fips_test.h incomplete evaluation.
* add missing null key checks to wc_ed25519_verify_msg_init(), wc_ed25519_verify_msg_update(), and wc_ed25519_verify_msg_final(). * add WC_ARG_NOT_NULL() attributes to args of static functions as appropriate. * add FIPS >v6 gates to new null key tests and a new invalid hash size test in test_wc_ed25519_sign_verify_ctx_ph() and test_wc_ed25519_verify_streaming().
…istant asymmetric algorithms (default: disabled)".
…h> where previously #include <wolfssl/wolfcrypt/types.h>, to retain standalone compilability without provoking circular dependencies via wc_compat.h.
…at_shim(), restore aes->reg to the supplied IV after wc_AesGcmEncrypt_ex() increments it, supporting the EVP access pattern.
…building FIPS < v7.
…_EXT_IV_ALLOWED isn't defined in old FIPS builds.
…ash", for the hash type in wc_PRF_fips(), for clarity and consistency.
…or-crypt.h, wolfcrypt/src/error.c: * Fix vector register restore on error paths in Sha3Update(). * Add SP 800-185 check against KMAC_FIPS_MIN_KEY in KmacInit() and KMAC_FIPS_MIN_OUTPUT in KmacFinal(), returning KMAC_MIN_KEYLEN_E and BAD_LENGTH_E respectively on failure. * Use word32 rather than byte for wc_Sha3.i, wc_Cshake.count, wc_Kmac.count, and related, and add explicit range checking where needed, to fix a -Wconversion, fix possible overruns, obviate 14 casts, and eliminate (negligible) runtime overhead from masking and promotions.
b05470c to
3f9bc8c
Compare
|
Only remaining CI failures are fips-ready due to missing ! |
Implement FIPS shimming for
wc_AesGcmEncrypt():wolfssl/wolfcrypt/aes.h: ifHAVE_FIPS&& !WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED, makewc_AesGcmEncrypt()aWOLFSSL_LOCAL, and if !_WC_BUILDING_AES_C, add aWC_DEPRECATED()attribute to it.wolfssl/wolfcrypt/wc_compat.h,wolfssl/wolfcrypt/include.am, .wolfssl_known_macro_extras: addwc_compat.h: whenHAVE_FIPSand !WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED, shimwc_AesGcmEncrypt()to remap it to FIPS-allowed APIs.wolfssl/wolfcrypt/types.h: at the end,#ifndefBUILDING_WOLFSSL,#include <wolfssl/wolfcrypt/wc_compat.h>, to assure transparent shimming ofwc_AesGcmEncrypt()for all outside callers.wolfcrypt/src/evp.c,wolfcrypt/src/hpke.c,wolfcrypt/src/pkcs7.c,wolfcrypt/benchmark/benchmark.c,wolfcrypt/test/test.c,wolfssl/ssl.h:#include <wolfssl/wolfcrypt/wc_compat.h>to shim in-library/in-module calls towc_AesGcmEncrypt().src/internal.c: inTicketEncDec(), addconstattributes toconstable input args, and fix swapped out/in in calls towc_AesGcmEncrypt().tests/api/test_aes.c: intest_wc_AesGcmEncryptDecrypt(), skiplongIVtest ifWC_TEST_AES_GCM_ENCRYPT_NO_NONSTD_IV(defined bywc_compat.hwhen needed).wolfssl/wolfcrypt/error-crypt.h,wolfssl/error-ssl.h,wolfcrypt/src/error.c,src/internal.c:FIPS_WRONG_API_E;wc_GetErrorString()switch().wc_static_assert()s from headers to corresponding .c files, to eliminate dependency onwolfcrypt/types.h;#include <wolfssl/wolfcrypt/types.h>fromerror-crypt.h.linuxkm/lkcapi_aes_glue.c: in the inner streaming loops for AES-GCM and AES-XTS (AesGcmCrypt_1(),km_AesXtsEncrypt(), andkm_AesXtsDecrypt()), bypass FIPS wrappers to avoid frivolous overhead, with decisive check after looping by the Final function.wolfcrypt/src/aes.c: revert atomic refactor ofcheckedAESNI,haveAESNI, andintel_flags(3f3ebca / #10871) to avoid frivolous atomic access overhead. Also use regularint, notcpuid_flags_atomic_t, forcpuid_flagsin theWOLFSSL_ARMASMpath, and similarly use a regularintforaes_ppc64_use_cryptoin theWOLFSSL_PPC64_ASM_CRYPTOpath.wolfssl/wolfcrypt/wc_compat.h,wolfssl/wolfcrypt/fips_test.h,.wolfssl_known_macro_extras:random.h,fips.h, andfips_test.h(circular dependencies).WC_FIPS_ENUM_CAST_ID_DEFINEDto allow detection offips_test.hincomplete evaluation.wolfcrypt/src/ed25519.c,tests/api/test_ed25519.c:wc_ed25519_verify_msg_init(),wc_ed25519_verify_msg_update(), andwc_ed25519_verify_msg_final().WC_ARG_NOT_NULL()attributes to args of static functions as appropriate.test_wc_ed25519_sign_verify_ctx_ph()andtest_wc_ed25519_verify_streaming().configure.ac: add--enable-all-quantum-crypto"Enable all quantum-resistant asymmetric algorithms (default: disabled)".tested in conjunction with FIPS 20260508-wrapper-signature-harmony and WolfGuard 20260713-wc_AesGcmEncrypt_fips using